use std::thread;
use std::time::Duration;

fn muuuuu(intensity: u32) -> u32 {
    println!("muuuuu...");
    thread::sleep(Duration::from_secs(2));
    intensity
}

fn workout(intensity: u32, random_number: u32) {
    let action = muuuuu;
    if intensity < 25 {
        println!("今天活力满满,先做{}个俯卧撑",action(intensity));    
    } else if random_number == 3 {
        println!("昨天练过度了,今天休息下吧!");
    } else {
        println!("昨天练过度了,今天干干有氧,跑步{}分钟!", action(intensity));
    }
}

fn main(){
    let intensity = 10;
    let random_number = 7;

    workout(intensity, random_number);

}
